<template>
  <div class="app-container">
    <el-collapse v-model="activeNames" class="collpe" @change="handleChange">
      <el-collapse-item :title="searchPor" name="search">
        <div class="app-head">
          <el-form>
            <el-row type="flex" justify="start">
              <el-col :span="7">
                <el-form-item label="用户中心ID" label-width="130px">
                  <el-input v-model.trim="userCenterId" style="width:90%" size="mini" />
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="业务平台账号" label-width="130px">
                  <el-input v-model.trim="userId" style="width:90%" size="mini" />
                </el-form-item>
              </el-col>
              <!-- <el-col :span="7">
                <el-form-item label="所属业务平台" label-width="160px">
                  <el-select v-model="platformId" style="width:90%" size="mini" placeholder="请选择">
                    <el-option value="" label="全部" />
                    <el-option v-for="item of platform" :key="item.typeId" :value="item.typeId" :label="item.typeName" />
                  </el-select>
                </el-form-item>
              </el-col> -->
              <el-col :span="7">
                <el-form-item label="是否冻结" label-width="130px">
                  <el-select v-model="userFreezestatus" style="width:90%" size="mini" placeholder="请选择">
                    <el-option value="" label="全部" />
                    <el-option value="1" label="是" />
                    <el-option value="2" label="否" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="2" class="flexd">
                <el-button
                  v-powerbtn="{power: platSearch}"
                  size="mini"
                  round
                  type="primary"
                  icon="el-icon-search"
                  @click="search"
                >查询</el-button>
              </el-col>
            </el-row>
            <el-row type="flex" justify="start">
              <el-col :span="7">
                <el-form-item label="用户状态" label-width="130px">
                  <el-select v-model="userStatus" style="width:90%" size="mini" placeholder="请选择">
                    <el-option value="" label="全部" />
                    <el-option value="1" label="待销售" />
                    <el-option value="2" label="待激活" />
                    <el-option value="3" label="激活" />
                    <el-option value="4" label="待销户" />
                    <el-option value="5" label="销户" />
                    <el-option value="6" label="超期未激活" />
                    <el-option value="7" label="服务过期" />
                    <!-- <el-option v-for="item of statusArr" :key="item.typeId" :value="item.typeId" :label="item.typeName" /> -->
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="TempToken" label-width="130px">
                  <el-input v-model="tempToken" style="width:90%" size="mini" />
                </el-form-item>
              </el-col>
              <!-- <el-col :span="7">
                <el-form-item label="是否关联其他平台账号" label-width="160px">
                  <el-select v-model="bindingStatus" style="width:90%" size="mini" placeholder="请选择">
                    <el-option v-for="item of account" :key="item.value" :value="item.value" :label="item.label" />
                  </el-select>
                </el-form-item>
              </el-col> -->
              <el-col :span="7">
                <el-form-item label="MAC地址" label-width="130px">
                  <el-input v-model="userBoxmac" style="width:90%" size="mini" />
                </el-form-item>
              </el-col>
              <el-col :span="2" class="flexd">
                <el-button
                  v-powerbtn="{power: platSearch}"
                  size="mini"
                  round
                  icon="el-icon-refresh"
                  @click="reset"
                >重置</el-button>
              </el-col>
            </el-row>
            <el-row type="flex" justify="start">
              <el-col :span="7">
                <el-form-item label="所属套餐" label-width="130px">
                  <el-select ref="vipHeight" v-model="packageId" style="width:90%" size="mini" placeholder="请选择">
                    <el-option value="1" label="基础套餐" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="用户类型" label-width="130px">
                  <el-select v-model="userType" style="width:90%" size="mini" placeholder="请选择">
                    <el-option value="" label="全部" />
                    <el-option
                      value="0"
                      label="其他"
                    />
                    <el-option
                      value="1"
                      label="公免用户"
                    />
                    <el-option
                      value="2"
                      label="认证黑名单"
                    />
                    <el-option
                      value="6"
                      label="商务用户"
                    />
                    <el-option
                      value="7"
                      label="测试用户"
                    />
                    <el-option
                      value="8"
                      label="集团大客户"
                    />
                    <el-option
                      value="9"
                      label="普通营业厅"
                    />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="7">
                <el-form-item label="是否限制增值业务" label-width="130px">
                  <el-select v-model="businessBlacklist" style="width:90%" size="mini" placeholder="请选择">
                    <el-option value="" label="全部" />
                    <el-option value="1" label="是" />
                    <el-option value="0" label="否" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="17">
                <el-form-item label="最近认证时间" label-width="130px">
                  <el-date-picker
                    v-model="loginBeginTime"
                    :picker-options="pickerOptions1"
                    :editable="false"
                    :style="tiemLen"
                    type="datetime"
                    size="mini"
                    format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss   "
                    placeholder="选择开始时间"
                    class="timeLength"
                  />
                  至
                  <el-date-picker
                    v-model="loginEndTime"
                    :picker-options="pickerOptions2"
                    :editable="false"
                    :style="tiemLen"
                    type="datetime"
                    size="mini"
                    format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss   "
                    placeholder="选择结束时间"
                  />
                </el-form-item>
              </el-col>
              <!-- <el-col :span="7">
                <el-form-item label="是否存在产品黑名单" label-width="160px">
                  <el-select style="width:90%" size="mini" placeholder="请选择">
                    <el-option value="" label="全部" />
                    <el-option value="1" label="是" />
                    <el-option value="2" label="否" />
                  </el-select>
                </el-form-item>
              </el-col> -->
            </el-row>
            <el-row type="flex" justify="start">
              <!-- <el-col :span="17">
                <el-form-item label="开户时间" label-width="130px">
                  <el-date-picker
                    v-model="startDate"
                    :picker-options="pickerOptions1"
                    :editable="false"
                    :style="tiemLen"
                    type="datetime"
                    size="mini"
                    format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss   "
                    placeholder="选择开始时间"
                    class="timeLength"
                    @change="checkStartTime"
                  />
                  至
                  <el-date-picker
                    v-model="endDate"
                    :picker-options="pickerOptions2"
                    :editable="false"
                    :style="tiemLen"
                    type="datetime"
                    size="mini"
                    format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss   "
                    placeholder="选择结束时间"
                    @change="checkTime"
                  />
                </el-form-item>
              </el-col> -->
            </el-row>
          </el-form>
          <div style="display:flex;justify-content:center;margin-top: 2px;">
            <div style="cursor:pointer;padding: 5px 35px;background:#bfdaff;color: #409eff;font-weight:bold;border-top-left-radius:28px;border-top-right-radius:28px;" @click="opening">
              <svg-icon :style="rorate" style="font-size:1rem;vertical-align: sub" icon-class="doubleArrow" />
              精简搜索
            </div>
          </div>
        </div>
      </el-collapse-item>
    </el-collapse>
    <div v-show="activeNames.length === 0" class="app-head">
      <el-form>
        <el-row type="flex" justify="start">
          <el-col :span="7">
            <el-form-item label="用户中心ID" label-width="130px">
              <el-input v-model.trim="userCenterId" style="width:90%" size="mini" />
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item label="业务平台账号" label-width="110px">
              <el-input v-model.trim="userId" style="width:90%" size="mini" />
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item label="是否冻结" label-width="160px">
              <el-select v-model="userFreezestatus" style="width:90%" size="mini" placeholder="请选择">
                <el-option value="" label="全部" />
                <el-option value="1" label="是" />
                <el-option value="2" label="否" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="2" class="flexd">
            <el-button
              size="mini"
              round
              type="primary"
              icon="el-icon-search"
              @click="search"
            >查询</el-button>
          </el-col>
        </el-row>
      </el-form>
      <div style="display:flex;justify-content:center;margin-top: 2px;">
        <div style="cursor:pointer;padding: 5px 35px;background:#bfdaff;color: #409eff;font-weight:bold;border-top-left-radius:28px;border-top-right-radius:28px;font-size:13px;" @click="opening">
          <svg-icon :style="rorate" style="font-size:1rem;vertical-align: sub" icon-class="doubleArrow" />
          高级搜索
        </div>
      </div>
    </div>
    <div class="addBtn">
      <el-button
        v-powerbtn="{power: platAdd}"
        type="primary"
        size="mini"
        style="margin-left:5px;"
        round
        icon="el-icon-circle-plus-outline"
        @click="add"
      >新增</el-button>
      <!-- :disabled="activated" -->
      <el-button
        v-powerbtn="{power: platalive}"
        type="primary"
        style="margin-left:5px;"
        size="mini"
        round
        icon="el-icon-success"
        @click="activate('激活用户', 'userActivate', '激活成功')"
      >激活用户</el-button>
      <!-- :disabled="checkActivate" -->
      <el-button
        v-powerbtn="{power: platUpstatus}"
        type="primary"
        style="width:102px;margin-left:5px;"
        size="mini"
        round
        icon="el-icon-circle-close"
        @click="destroy"
      >设为待销户</el-button>
      <el-button
        v-powerbtn="{power: plataImexcel}"
        type="primary"
        size="mini"
        style="margin-left:5px;width:130px"
        round
        icon="el-icon-upload2"
        @click="upin"
      >文件导入用户</el-button>
      <el-button
        v-powerbtn="{power: plataImoper}"
        type="primary"
        size="mini"
        round
        style="width:130px;margin-left:5px"
        @click="uploadUp"
      >导入运营商用户
      </el-button>

      <el-button
        v-powerbtn="{power: plataUnableorder}"
        type="primary"
        size="mini"
        style="width:130px;margin-left:5px"
        round
        icon="el-icon-success"
        @click="activate('限制增值业务', 'joinBusinessBlacklist', '限制成功')"
      >限制增值业务</el-button>
      <el-button
        v-powerbtn="{power: plataUnableorder}"
        type="primary"
        size="mini"
        style="width:140px;margin-left:5px"
        round
        icon="el-icon-success"
        @click="activate('取消限制增值业务', 'cancelBusinessBlacklist', '取消成功')"
      >取消限制增值业务</el-button>
    </div>
    <div class="addBtn" style="margin-top:10px;">
      <el-button
        v-powerbtn="{power: plataFreezeuser}"
        type="primary"
        size="mini"
        style="margin-left:5px;"
        round
        icon="el-icon-success"
        @click="activate('冻结账号', 'freezeUser', '冻结成功')"
      >冻结</el-button>
      <el-button
        v-powerbtn="{power: plataFreezeuser}"
        type="primary"
        size="mini"
        style="margin-left:5px;"
        round
        icon="el-icon-success"
        @click="activate('取消冻结', 'unfreeze', '取消成功')"
      >取消冻结</el-button>
      <el-button
        v-powerbtn="{power: platalive}"
        type="primary"
        size="mini"
        style="width:102px;margin-left:5px"
        round
        icon="el-icon-success"
        @click="activate('强制下线', 'forcedOffline', '下线成功')"
      >强制下线</el-button>
      <el-button
        v-powerbtn="{power: plataInsertauthorblack}"
        type="primary"
        size="mini"
        round
        style="width:130px;margin-left:5px"
        icon="el-icon-success"
        @click="activate('加入认证黑名单', 'joinAAABlacklist', '加入成功')"
      >加入认证黑名单</el-button>
      <el-button
        v-powerbtn="{power: plataInsertauthorblack}"
        type="primary"
        size="mini"
        style="width:130px;margin-left:5px"
        round
        icon="el-icon-success"
        @click="activate('取消认证黑名单', 'cancelAAABlacklist', '取消成功')"
      >取消认证黑名单</el-button>
      <el-button
        v-powerbtn="{power: plataDelmac}"
        type="primary"
        size="mini"
        style="width:130px;margin-left:5px"
        round
        icon="el-icon-success"
        @click="activate('解绑MAC地址', 'unbindMAC', '解绑成功')"
      >解绑MAC地址</el-button>
      <!-- <el-button
        v-powerbtn="{power: 'usercenter-search-alive'}"
        :disabled="activated"
        type="primary"
        size="mini"
        round
        icon="el-icon-success"
        @click="activate"
      >关联账号详情</el-button> -->
      <!-- <el-button
        type="primary"
        size="mini"
        round
        icon="el-icon-upload2"
        @click="uploadUp"
      >导入运营商用户</el-button> -->
      <el-button
        type="primary"
        size="mini"
        style="width:140px;margin-left:5px"
        round
        icon="el-icon-success"
        @click="upChangeHandle"
      >批量修改用户信息</el-button>
    </div>
    <div class="app-table">
      <el-table :data="newList" border style="width: 100%" @selection-change="handleSelectionChange">
        <el-table-column
          type="selection"
          width="55" />
        <el-table-column fixed="left" show-overflow-tooltip label="业务平台账号" min-width="100" prop="userId">
          <!-- <template slot-scope="scope">
            <el-popover v-show="scope.row.userId" :content="scope.row.userId" placement="top" trigger="hover">
              <span slot="reference" style="cursor:pointer">{{ scope.row.userId }}</span>
            </el-popover>
          </template> -->
        </el-table-column>
        <el-table-column fixed="left" show-overflow-tooltip label="用户中心ID" min-width="100" prop="userCenterId">
          <!-- <template slot-scope="scope">
            {{ scope.row.userCenterId }}
            <el-popover v-show="scope.row.userCenterId" :content="scope.row.userCenterId" placement="top" trigger="hover">
              <span slot="reference" style="cursor:pointer">{{ scope.row.userCenterId }}</span>
            </el-popover>
          </template> -->
        </el-table-column>
        <el-table-column fixed="left" show-overflow-tooltip label="TempToken" min-width="100" prop="tempToken">
          <!-- <template slot-scope="scope">
            <el-popover v-show="scope.row.tempToken" :content="scope.row.tempToken" placement="top" trigger="hover">
              <span slot="reference" style="cursor:pointer">{{ scope.row.tempToken }}</span>
            </el-popover>
          </template> -->
        </el-table-column>
        <!-- <el-table-column label="所属业务平台" min-width="100">
          <template slot-scope="scope">
            <el-popover v-if="scope.row.platformId" :content="scope.row.platformId" placement="top" trigger="hover">
              <span slot="reference" style="cursor:pointer">{{ scope.row.platformId }}</span>
            </el-popover>
          </template>
        </el-table-column> -->
        <!-- <el-table-column label="是否匹配其他平台账号" min-width="150">
          <template slot-scope="scope">
            {{ scope.row.bindingStatus === '0' ? '否' : '是' }}
          </template>
        </el-table-column> -->
        <el-table-column label="用户状态" min-width="70">
          <template slot-scope="scope">
            <span v-if="scope.row.userStatus === '1'">待销售</span>
            <span v-if="scope.row.userStatus === '2'">待激活</span>
            <span v-if="scope.row.userStatus === '3'">激活</span>
            <span v-if="scope.row.userStatus === '4'">待销户</span>
            <span v-if="scope.row.userStatus === '5'">销户</span>
            <span v-if="scope.row.userStatus === '6'">超期未激活</span>
            <span v-if="scope.row.userStatus === '7'">服务过期</span>
          </template>
        </el-table-column>
        <el-table-column label="是否冻结" min-width="70" prop="userFreezestatusStr">
          <!-- <template slot-scope="scope">
            {{ scope.row.userFreezestatusStr === '2' ? '否' : '是' }}
          </template> -->
        </el-table-column>
        <el-table-column label="MAC地址" show-overflow-tooltip min-width="100" prop="userBoxmac">
          <!-- <template slot-scope="scope">
            <el-popover v-show="scope.row.userBoxmac" :content="scope.row.userBoxmac" placement="top" trigger="hover">
              <span slot="reference" style="cursor:pointer">{{ scope.row.userBoxmac }}</span>
            </el-popover>
          </template> -->
        </el-table-column>
        <!-- <el-table-column label="开户时间" min-width="95">
          <template slot-scope="scope">
            <el-popover v-if="scope.row.userCreatetime" :content="scope.row.userCreatetime" placement="top" trigger="hover">
              <span slot="reference" style="cursor:pointer">{{ scope.row.userCreatetime }}</span>
            </el-popover>
          </template>
        </el-table-column> -->
        <el-table-column label="最近认证时间" show-overflow-tooltip min-width="95" prop="userLogintime">
          <!-- <template slot-scope="scope">
            <el-popover v-show="scope.row.userLogintime" :content="scope.row.userLogintime" placement="top" trigger="hover">
              <span slot="reference" style="cursor:pointer">{{ scope.row.userLogintime }}</span>
            </el-popover>
          </template> -->
        </el-table-column>
        <!-- <el-table-column label="会员级别" min-width="80">
          <template slot-scope="scope">
            {{ scope.row.membershipLevel }}
          </template>
        </el-table-column> -->
        <el-table-column label="所属套餐" min-width="90" prop="packageIdStr">
          <!-- <template slot-scope="scope">
            {{ scope.row.packageId === '1' ? '基础套餐' : '其他套餐' }}
          </template> -->
        </el-table-column>
        <el-table-column label="用户类型" min-width="95">
          <template slot-scope="scope">
            <span v-show="scope.row.userType === '0'">其他</span>
            <span v-show="scope.row.userType === '1'">公免用户</span>
            <span v-show="scope.row.userType === '2'">认证黑名单</span>
            <span v-show="scope.row.userType === '6'">商务用户</span>
            <span v-show="scope.row.userType === '7'">测试用户</span>
            <span v-show="scope.row.userType === '8'">集团大客户</span>
            <span v-show="scope.row.userType === '9'">普通营业厅</span>
          </template>
        </el-table-column>
        <el-table-column label="限制增值业务" min-width="110" prop="businessBlacklistStr">
          <!-- <template slot-scope="scope">
            {{ scope.row.businessBlacklist === '0' ? '否' : '是' }}
          </template> -->
        </el-table-column>
        <el-table-column label="操作" min-width="135">
          <template slot-scope="scope">
            <!-- v-powerbtn="{power: 'usercenter-search-detail'}" -->
            <el-button
              v-powerbtn="{power: plataFind}"
              type="primary"
              round
              plain
              size="mini"
              @click="watch(scope.row.userId, scope.row.platformId)"
            >查看</el-button>
            <!-- v-powerbtn="{power: 'usercenter-search-detail'}"  -->
            <el-button
              v-powerbtn="{power: plataEdit}"
              type="primary"
              round
              style="margin-left: 0"
              plain
              size="mini"
              @click="edit(scope.row.userId, scope.row.platformId, scope.row.id)"
            >编辑</el-button>
            <!-- <el-button
              v-powerbtn="{power: 'usercenter-search-detail'}"
              type="primary"
              style="margin-left: 0"
              round
              plain
              size="mini"
              @click="maxAddress(scope.row.userId, scope.row.platformId)"
            >解绑MAC地址</el-button> -->
            <!-- <el-button
              v-show="scope.row.userFreezestatus !== '2'"
              type="primary"
              style="margin-left: 0"
              round
              plain
              size="mini"
              @click="cancelIce(scope.row.userId, scope.row.platformId)"
            >取消冻结</el-button> -->
            <!-- <el-button
              v-show="scope.row.userFreezestatus === '2'"
              type="primary"
              style="margin-left: 0"
              round
              plain
              size="mini"
              @click="ice(scope.row.userId, scope.row.platformId)"
            >冻结</el-button> -->
            <!-- <el-dropdown @command="handleCommand">
              <el-button
                v-powerbtn="{power: 'usercenter-search-detail'}"
                type="primary"
                style="margin-left: 0"
                round
                plain
                size="mini"
              >黑名单管理<i class="el-icon-arrow-down el-icon--right" /></el-button>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item v-show="scope.row.userType !== '2'" :command="'%' + scope.row.userId + ':' + scope.row.platformId">加入认证黑名单</el-dropdown-item>
                <el-dropdown-item v-show="scope.row.userType === '2'" :command="'$' + scope.row.userId + ':' + scope.row.platformId">取消认证黑名单</el-dropdown-item>
                <el-dropdown-item v-show="scope.row.businessBlacklist === '1'" :command="'^' + scope.row.userId + ':' + scope.row.platformId">取消业务黑名单</el-dropdown-item>
                <el-dropdown-item v-show="scope.row.businessBlacklist === '0'" :command="'~' + scope.row.userId + ':' + scope.row.platformId">加入业务黑名单</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown> -->
            <!-- <el-dropdown @command="handleCommandMore">
              <el-button
                type="primary"
                style="margin-left: 0"
                round
                plain
                size="mini"
              >更多<i class="el-icon-arrow-down el-icon--right" /></el-button>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-powerbtn="{power: plataDelmac}"
                  :command="'#' + scope.row.userId + ':' + scope.row.platformId"
                >解绑MAC地址</el-dropdown-item>
                <el-dropdown-item
                  v-powerbtn="{power: plataFreezeuser}"
                  :command="'*' + scope.row.userId + ':' + scope.row.platformId"
                ><span v-show="scope.row.userFreezestatus === '2'">冻结账号</span></el-dropdown-item>

                <el-dropdown-item v-powerbtn="{power: plataFreezeuser}" :command="'@' + scope.row.userId + ':' + scope.row.platformId"><span v-show="scope.row.userFreezestatus !== '2'">取消冻结</span></el-dropdown-item>

                <el-dropdown-item v-powerbtn="{power: plataAssuserinfo}" :command="'~' + JSON.stringify(scope.row)">关联账号详情</el-dropdown-item>

                <el-dropdown-item v-powerbtn="{power: plataInsertauthorblack}" :command="'%' + scope.row.userId + ':' + scope.row.platformId"><span v-show="scope.row.userType !== '2'">加入认证黑名单</span></el-dropdown-item>

                <el-dropdown-item v-powerbtn="{power: plataInsertauthorblack}" :command="'$' + scope.row.userId + ':' + scope.row.platformId"><span v-show="scope.row.userType === '2'">取消认证黑名单</span></el-dropdown-item>

                <el-dropdown-item v-powerbtn="{power: plataUnableorder}" :command="'^' + scope.row.userId + ':' + scope.row.platformId"><span v-show="scope.row.businessBlacklist === '1'">取消限制增值业务</span></el-dropdown-item>

                <el-dropdown-item v-powerbtn="{power: plataUnableorder}" :command="'?' + scope.row.userId + ':' + scope.row.platformId"><span v-show="scope.row.businessBlacklist === '0'">限制增值业务</span></el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown> -->
            <!-- <el-button
              v-powerbtn="{power: 'usercenter-search-detail'}"
              type="primary"
              style="margin-left: 0"
              round
              plain
              size="mini"
              @click="connectNum(scope.row)"
            >关联账号详情</el-button> -->
            <!-- <el-button
              type="primary"
              plain
              size="mini"
              round
              @click="watchPoint(scope.row)"
            >积分</el-button> -->
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination-container">
        <el-pagination :current-page="pageid" :page-sizes="[20,50,100]" :page-size="pagecount" :total="count" background highlight-current-row layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
      </div>
    </div>
    <!-- <connect-plat v-if="status" :point-dialogplat="pointDialogplat" :search-request="searchRequest" :scope="scope" @closePoint="closePoint" /> -->
    <watch-info :dialog-table-visible="dialogTableVisible" :plat-form="platform" :platformid-value="platformIdValue" :user-id="userIds" @closeDialog="closeDialog" />
    <edit-info :dislog-edit="dislogEdit" :read-id="readId" :plat-form="platform" :user-id="userIds" :platformid-value="platformIdValue" @closeDialog="closeDialog" />
    <add-info :dialog-add="dialogAdd" :plat-form="platformId" @closeDialog="closeDialog" />
    <!-- <user-point :point-dialog="pointDialog" :info="info" :platform-term="platformTerm" @closePointss="closePointss" /> -->
    <connect-num :connect-val="connectVal" :data-val="dataVal" @closeDialog="closeDialog" />
    <excel-in :up-excel="upExcel" @closeExcel="closeExcel"/>
    <user-point :point-dialog="pointDialog" :info="info" :platform-term="platformTerm" @closePointss="closePointss" />
    <up-changes :platform-id="platformId" :up-change="upChange" @closeChange="closeChange" />
  </div>
</template>
<script>
import secret from '@/utils/secret'
import {
  newList,
  newStatus,
  getSelect,
  // newSelect,
  newOperator,
  getVipSelect
} from '@/api/search'
import {
  mapGetters
} from 'vuex'
import excelIn from '@/views/search/components/excelIn.vue'
import powerbtn from '@/directive/powerbtn/index.js'
import addInfo from './components/add.vue'
import editInfo from './components/edit.vue'
import WatchInfo from '@/views/search/components/watchInfo.vue'
import connectNum from '@/views/search/components/connectNum.vue'
import UserPoint from './components/point.vue'
import upChanges from '@/views/search/components/changeExcel.vue'
export default {
  name: 'Search',
  directives: {
    powerbtn
  },
  components: {
    // connectPlat: connectPlat, // 关联平台
    WatchInfo: WatchInfo, // 查看详细信息
    UserPoint: UserPoint, // 用户积分
    excelIn: excelIn,
    editInfo: editInfo,
    addInfo: addInfo,
    connectNum: connectNum,
    upChanges: upChanges
  },
  data() {
    return {
      find: '',
      upChange: false,
      platAdd: '',
      platalive: '',
      platUpstatus: '',
      plataImoper: '',
      plataImexcel: '',
      plataFind: '',
      plataEdit: '',
      plataDelmac: '',
      plataFreezeuser: '',
      plataAssuserinfo: '',
      plataInsertauthorblack: '',
      plataUnableorder: '',
      rorate: {
        transform: 'rotate(-90deg)'
      },
      activeNames: ['search'],
      point: '',
      connects: '',
      general: '',
      integral: '',
      watchs: '',
      searchPor: '折叠搜索条件',
      powerful: null,
      date: null,
      status: true,
      platformIdNew: '',
      stat: false,
      platformIdValue: '',
      userIds: '',
      userType: '',
      tempToken: '',
      businessBlacklis: '',
      platform: null, // 平台标识list
      upExcel: false, // 导入excel
      listArr: [],
      dialogAdd: false,
      membershipLevel: '',
      vipList: [],
      packageId: '',
      dataVal: {},
      connectVal: false,
      userBoxmac: '',
      platformId: '', // 平台标识
      account: [{
        value: '',
        label: '全部'
      }, {
        value: '1',
        label: '是'
      }, {
        value: '0',
        label: '否'
      }],
      userStatus: '',
      userFreezestatus: '',
      statusArr: [{
        value: '1',
        label: '待销售'
      }, {
        value: '2',
        label: '待激活'
      }, {
        value: '3',
        label: '激活'
      }, {
        value: '4',
        label: '待销户'
      }, {
        value: '5',
        label: '销户'
      }, {
        value: '6',
        label: '超期未激活'
      }, {
        value: '7',
        label: '服务过期'
      }],
      newList: [],
      tiemLen: '',
      platSearch: '',
      readId: '',
      loginBeginTime: '',
      loginEndTime: '',
      searchRequest: Object, // 请求数据
      bindingStatus: '',
      list: null, // 列表
      businessBlacklist: '',
      pageid: 1, // 当前页数
      pagecount: 20, // 每页显示条数
      count: 0, // 总数量
      pages: null, // 总页数
      userCenterId: '', // 唯一身份标识
      userId: '', // 平台账号
      pointDialogplat: false, // 关联平台遮罩
      scope: null, // 传值
      dialogTableVisible: false, // 查看详细遮罩
      dislogEdit: false,
      plat: '', // 平台id
      id: null, // userCenterId
      pointDialog: false, // 积分遮罩
      info: null, // 信息
      power: [], // 按钮权限
      total_search: false, // 查询重置按钮
      total_find: false, // 查看详细
      total_general: false, // 用户通用信息
      total_integral: false, // 用户积分
      platformTerm: null,
      endDate: '', // 结束时间
      startDate: '', // 开始日期
      pickerOptions1: {
        disabledDate(time) {
          return time.getTime() > Date.now()
        }
      },
      pickerOptions2: {
        disabledDate(time) {
          return time.getTime() > Date.now()
        }
      },
      param: Object, // 搜索条件
      flag: true // 改变当前显示页数
    }
  },
  computed: {
    ...mapGetters(['assignment', 'token']),
    checkActivate() {
      if (this.listArr.length > 0) {
        for (let i = 0; i < this.listArr.length; i++) {
          if (this.listArr[i].userStatus === '4') {
            return true
          }
        }
      }
      if (this.listArr.length === 0) {
        return false
      } else {
        return false
      }
    },
    activated() {
      if (this.listArr.length > 0) {
        for (let i = 0; i < this.listArr.length; i++) {
          if (this.listArr[i].userStatus === '3') {
            return true
          }
        }
      }
      if (this.listArr.length === 0) {
        return false
      } else {
        return false
      }
    }
  },
  watch: {
    $route(to, from) {
      console.log(2)
      this.find = this.$route.meta.powerName + '-search' // 搜索权限按钮
      this.point = this.$route.meta.powerName + '-integral' // 积分权限按钮
      this.connects = this.$route.meta.powerName + '-platform' // 关联平台
      this.general = this.$route.meta.powerName + '-general' // 关联平台
      this.watchs = this.$route.meta.powerName + '-find' // 查看权限按钮
      this.person = '' // 身份标识重置
      this.platMount = '' // 平台账号
      this.accountValue = '' // 状态
      this.startDate = ''
      this.endDate = ''
      this.pageid = 1
      this.pagecount = 20
      this.param.userCenterId = ''
      this.param.userId = ''
      this.param.bindingStatus = ''
      this.param.starttime = ''
      this.param.endtime = ''
      var len = this.$route.meta.platformId.indexOf('-')
      this.platformId = this.$route.meta.platformId.substr(len + 1)
      console.log(this.platformId)
      this.$nextTick(() => {
        this.platSearch = 'usercenter-' + this.platformId + '|usermanage-search' // 搜索
        this.platAdd = 'usercenter-' + this.platformId + '|usermanage-add' // 新增
        this.platalive = 'usercenter-' + this.platformId + '|usermanage-alive' // 激活
        this.platUpstatus = 'usercenter-' + this.platformId + '|usermanage-upstatus' // 待销户
        this.plataImoper = 'usercenter-' + this.platformId + '|usermanage-imoper' // 导入运营商用户
        this.plataImexcel = 'usercenter-' + this.platformId + '|usermanage-imexcel' // 文件导入用户
        this.plataFind = 'usercenter-' + this.platformId + '|usermanage-find' // 查看
        this.plataEdit = 'usercenter-' + this.platformId + '|usermanage-edit' // 编辑
        this.plataDelmac = 'usercenter-' + this.platformId + '|usermanage-delmac' // 解绑MAC
        this.plataFreezeuser = 'usercenter-' + this.platformId + '|usermanage-freezeuser' // 冻结
        this.plataAssuserinfo = 'usercenter-' + this.platformId + '|usermanage-assuserinfo' // 关联账号详情
        this.plataInsertauthorblack = 'usercenter-' + this.platformId + '|usermanage-insertauthorblack' // 加入认证黑名单
        this.plataUnableorder = 'usercenter-' + this.platformId + '|usermanage-unableorder' // 限制增值业务
      })
      console.log('请求参数')
      this.search(this.platformId)
      this.getSelectList()
    }
  },
  mounted() {
    console.log(this.assignment)
    this.$nextTick(() => {
      var len = this.$refs.vipHeight.$el.offsetWidth
      console.log(len)
      this.tiemLen = {
        'width': len + 'px'
      }
    })
    // 获取页面初加载请求
    this.find = this.$route.meta.powerName + '-search' // 搜索权限按钮
    this.point = this.$route.meta.powerName + '-integral' // 积分权限按钮
    this.connects = this.$route.meta.powerName + '-platform' // 关联平台
    this.general = this.$route.meta.powerName + '-general' // 关联平台
    // this.integral = this.$route.meta.powerName + '-point' // 积分权限按钮
    this.watchs = this.$route.meta.powerName + '-find' // 查看权限按钮
    var len = this.$route.meta.platformId.indexOf('-')
    this.platformId = this.$route.meta.platformId.substr(len + 1)
    console.log(this.platformId)
    console.log('请求参数')
    this.$nextTick(() => {
      this.platSearch = 'usercenter-' + this.platformId + '|usermanage-search' // 搜索
      this.platAdd = 'usercenter-' + this.platformId + '|usermanage-add' // 新增
      this.platalive = 'usercenter-' + this.platformId + '|usermanage-alive' // 激活
      this.platUpstatus = 'usercenter-' + this.platformId + '|usermanage-upstatus' // 待销户
      this.plataImoper = 'usercenter-' + this.platformId + '|usermanage-imoper' // 导入运营商用户
      this.plataImexcel = 'usercenter-' + this.platformId + '|usermanage-imexcel' // 文件导入用户
      this.plataFind = 'usercenter-' + this.platformId + '|usermanage-find' // 查看
      this.plataEdit = 'usercenter-' + this.platformId + '|usermanage-edit' // 编辑
      this.plataDelmac = 'usercenter-' + this.platformId + '|usermanage-delmac' // 解绑MAC
      this.plataFreezeuser = 'usercenter-' + this.platformId + '|usermanage-freezeuser' // 冻结
      this.plataAssuserinfo = 'usercenter-' + this.platformId + '|usermanage-assuserinfo' // 关联账号详情
      this.plataInsertauthorblack = 'usercenter-' + this.platformId + '|usermanage-insertauthorblack' // 加入认证黑名单
      this.plataUnableorder = 'usercenter-' + this.platformId + '|usermanage-unableorder' // 限制增值业务
    })
    this.getSelectList()
    this.search(this.platformId)
  },
  methods: {
    closeChange() {
      this.upChange = false
    },
    // 请求下拉
    getSelectList() {
      getVipSelect().then(res => {
        if (res.resultCode === '0000') {
          var list = res.data.list
          this.vipList = list
        }
      })
      // 平台
      var data = {
        functionType: 'platform'
      }
      getSelect(secret.Encrypt(data)).then(res => {
        this.platform = res.data.list
      })
    },
    opening() {
      this.activeNames.length > 0 ? this.activeNames.shift() : this.activeNames.push('search')
      this.searchPor = this.activeNames.length > 0 ? '折叠搜索条件' : '展开搜索条件'
      this.rorate.transform = this.activeNames.length > 0 ? 'rotate(-90deg)' : 'rotate(90deg)'
      // transform: 'rotate(90deg)'
    },
    handleChange(val) {
      if (val.length === 0) {
        this.searchPor = '展开搜索条件'
      } else {
        this.searchPor = '折叠搜索条件'
      }
    },
    closeExcel() {
      this.upExcel = false
    },
    upin() {
      this.upExcel = true
    },
    add() {
      this.dialogAdd = true
    },
    handleCommand(command) {
      // var userId = command.substr(1, command.length - 1)
      var index = command.indexOf(':')
      var realUserId = command.substr(1, index - 1)
      var platForm = command.substr(index + 1, command.length - 1)
      console.log(realUserId)
      console.log(platForm)
      if (command.indexOf('%') === 0) {
        this.$confirm('确定加入认证黑名单吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinBlack = {
            type: 'joinAAABlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '加入黑名单成功'
              })
              this.search()
            }
          })
        })
      }
      if (command.indexOf('$') === 0) {
        this.$confirm('取消加入认证黑名单吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinBlack = {
            type: 'cancelAAABlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '加入黑名单成功'
              })
              this.search()
            }
          })
        })
      }
      if (command.indexOf('~') === 0) {
        this.$confirm('确定加入业务黑名单吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinYewuBlack = {
            type: 'joinBusinessBlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinYewuBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '加入黑名单成功'
              })
              this.search()
            }
          })
        })
      }
      if (command.indexOf('^') === 0) {
        this.$confirm('确定取消业务黑名单吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinYewuBlack = {
            type: 'cancelBusinessBlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinYewuBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '取消黑名单成功'
              })
              this.search()
            }
          })
        })
      }
    },
    handleCommandMore(command) {
      if (command.indexOf('#') === 0) {
        const index = command.indexOf(':')
        const realUserId = command.substr(1, index - 1)
        const platForm = command.substr(index + 1, command.length - 1)
        this.maxAddress(realUserId, platForm)
      }
      // 冻结
      if (command.indexOf('*') === 0) {
        const index = command.indexOf(':')
        const realUserId = command.substr(1, index - 1)
        const platForm = command.substr(index + 1, command.length - 1)
        this.ice(realUserId, platForm)
      }
      // 取消冻结
      if (command.indexOf('@') === 0) {
        const index = command.indexOf(':')
        const realUserId = command.substr(1, index - 1)
        const platForm = command.substr(index + 1, command.length - 1)
        this.cancelIce(realUserId, platForm)
      }
      // 积分查看
      if (command.indexOf('&') === 0) {
        const platForm = command.substr(1, command.length - 1)
        const obj = JSON.parse(platForm)
        this.watchPoint(obj)
      }
      // 关联账号详情
      if (command.indexOf('~') === 0) {
        const platForm = command.substr(1, command.length - 1)
        const obj = JSON.parse(platForm)
        this.connectNum(obj)
      }
      // 加入认证黑名单
      if (command.indexOf('%') === 0) {
        const index = command.indexOf(':')
        const realUserId = command.substr(1, index - 1)
        const platForm = command.substr(index + 1, command.length - 1)
        console.log(command)
        console.log(realUserId)
        console.log(platForm)
        this.$confirm('确定加入认证黑名单吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinBlack = {
            type: 'joinAAABlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '加入黑名单成功'
              })
              this.search()
            }
          })
          /* this.$message({
            type: 'success',
            message: '加入成功'
          }) */
        })
      }
      // 取消认证黑名单
      if (command.indexOf('$') === 0) {
        const index = command.indexOf(':')
        const realUserId = command.substr(1, index - 1)
        const platForm = command.substr(index + 1, command.length - 1)
        this.$confirm('确定取消认证黑名单吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinBlack = {
            type: 'cancelAAABlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '取消成功'
              })
              this.search()
            }
          })
          /* this.$message({
            type: 'success',
            message: '加入成功'
          }) */
        })
      }
      // 加入业务黑名单
      if (command.indexOf('?') === 0) {
        const index = command.indexOf(':')
        const realUserId = command.substr(1, index - 1)
        const platForm = command.substr(index + 1, command.length - 1)
        this.$confirm('确定限制增值业务吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinYewuBlack = {
            type: 'joinBusinessBlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinYewuBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '操作成功'
              })
              this.search()
            }
          })
        })
      }
      // 取消业务黑名单
      if (command.indexOf('^') === 0) {
        const index = command.indexOf(':')
        const realUserId = command.substr(1, index - 1)
        const platForm = command.substr(index + 1, command.length - 1)
        this.$confirm('确定取消限制增值业务吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          var joinYewuBlack = {
            type: 'cancelBusinessBlacklist',
            platformId: platForm,
            userId: realUserId
          }
          newStatus(secret.Encrypt(joinYewuBlack)).then(res => {
            if (res.resultCode === '0000') {
              this.$message({
                type: 'success',
                message: '取消成功'
              })
              this.search()
            }
          })
        })
      }
    },
    handleSelectionChange(val) {
      this.listArr = val
    },
    // 跳转某页
    handleCurrentChange(num) {
      this.pageid = num // 当前页数
      console.log(num)
      const data = {
        userCenterId: this.userCenterId,
        userId: this.userId,
        loginBeginTime: this.loginBeginTime,
        loginEndTime: this.loginEndTime,
        userType: this.userType,
        businessBlacklist: this.businessBlacklist,
        platformId: this.platformId,
        bindingStatus: this.bindingStatus,
        userStatus: this.userStatus,
        userFreezestatus: this.userFreezestatus,
        userBoxmac: this.userBoxmac,
        beginTime: this.startDate,
        endTime: this.endDate,
        membershipLevel: this.membershipLevel,
        packageId: this.packageId,
        pageid: num,
        pagecount: this.pagecount
      }
      console.log('请求数据')
      console.log(data)
      // if (this.flag === true) {
      newList(secret.Encrypt(data)).then(response => {
        if (Array.isArray(response.data.list) && response.data.list.length > 0) {
          response.data.list.forEach(item => {
            if (item.userFreezestatus === '2') {
              item.userFreezestatusStr = '否'
            } else {
              item.userFreezestatusStr = '是'
            }
            if (item.businessBlacklist === '0') {
              item.businessBlacklistStr = '否'
            } else {
              item.businessBlacklistStr = '是'
            }
            if (item.packageId === '1') {
              item.packageIdStr = '基础套餐'
            } else {
              item.packageIdStr = '其他套餐'
            }
          })
        }
        this.newList = response.data.list // 列表项
        this.count = parseInt(response.data.count) // 总数量
        console.log('返回数据')
        console.log(response.data)
      })
      // }
    },
    // 当前页面改变时
    handleSizeChange(num) {
      this.flag = false
      const data = {
        userCenterId: this.userCenterId,
        userId: this.userId,
        platformId: this.platformId,
        loginBeginTime: this.loginBeginTime,
        loginEndTime: this.loginEndTime,
        userType: this.userType,
        businessBlacklist: this.businessBlacklist,
        bindingStatus: this.bindingStatus,
        userStatus: this.userStatus,
        userFreezestatus: this.userFreezestatus,
        userBoxmac: this.userBoxmac,
        beginTime: this.startDate,
        endTime: this.endDate,
        membershipLevel: this.membershipLevel,
        packageId: this.packageId,
        pageid: 1,
        pagecount: parseInt(num)
      }
      console.log('请求数据')
      console.log(data)
      newList(secret.Encrypt(data)).then(response => {
        if (Array.isArray(response.data.list) && response.data.list.length > 0) {
          response.data.list.forEach(item => {
            if (item.userFreezestatus === '2') {
              item.userFreezestatusStr = '否'
            } else {
              item.userFreezestatusStr = '是'
            }
            if (item.businessBlacklist === '0') {
              item.businessBlacklistStr = '否'
            } else {
              item.businessBlacklistStr = '是'
            }
            if (item.packageId === '1') {
              item.packageIdStr = '基础套餐'
            } else {
              item.packageIdStr = '其他套餐'
            }
          })
        }
        this.pagecount = num
        this.pageid = 1
        this.flag = true
        this.newList = response.data.list // 列表项
        this.count = parseInt(response.data.count) // 总数量
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    },
    upChangeHandle() {
      this.upChange = true
    },
    // 搜索
    search() {
      const param = {
        userCenterId: this.userCenterId,
        userId: this.userId,
        platformId: this.platformId,
        bindingStatus: this.bindingStatus,
        userStatus: this.userStatus,
        userFreezestatus: this.userFreezestatus,
        userBoxmac: this.userBoxmac,
        beginTime: this.startDate ? this.startDate : '',
        endTime: this.endDate ? this.endDate : '',
        membershipLevel: this.membershipLevel,
        packageId: this.packageId,
        loginBeginTime: this.loginBeginTime,
        loginEndTime: this.loginEndTime,
        userType: this.userType,
        businessBlacklist: this.businessBlacklist,
        tempToken: this.tempToken,
        pageid: 1,
        pagecount: this.pagecount
      }
      this.param = param
      console.log('请求参数')
      console.log(param)
      newList(secret.Encrypt(param)).then(response => {
        if (Array.isArray(response.data.list) && response.data.list.length > 0) {
          response.data.list.forEach(item => {
            if (item.userFreezestatus === '2') {
              item.userFreezestatusStr = '否'
            } else {
              item.userFreezestatusStr = '是'
            }
            if (item.businessBlacklist === '0') {
              item.businessBlacklistStr = '否'
            } else {
              item.businessBlacklistStr = '是'
            }
            if (item.packageId === '1') {
              item.packageIdStr = '基础套餐'
            } else {
              item.packageIdStr = '其他套餐'
            }
          })
        }
        this.newList = response.data.list // 列表项
        this.count = parseInt(response.data.count) // 总数量
        this.pages = response.data.pages // 总页数
        this.pageid = parseInt(response.data.pageid) // 当前页数
        // this.pagecount = parseInt(response.data.pagecount) // 当前显示条数
        console.log('返回数据')
        console.log(response.data)
        this.searchRequest = param
        this.status = true
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    },
    uploadUp() {
      var data = {
        platformId: this.platformId
      }
      newOperator(secret.Encrypt(data)).then(res => {
        if (res.resultCode === '0000') {
          this.$message({
            type: 'success',
            message: '导入成功'
          })
          this.search()
        }
      })
    },
    // 重置
    reset() {
      this.userCenterId = ''
      this.userId = ''
      this.bindingStatus = ''
      this.userStatus = ''
      this.userFreezestatus = ''
      this.userBoxmac = ''
      this.startDate = ''
      this.endDate = ''
      this.membershipLevel = ''
      this.packageId = ''
      this.tempToken = ''
      this.userType = ''
      this.businessBlacklist = ''
      this.loginBeginTime = ''
      this.loginEndTime = ''
    },
    // 查看详情
    watch(userId, platformIdValue) {
      this.dialogTableVisible = true
      this.userIds = userId
      this.platformIdValue = platformIdValue
    },
    edit(userId, platformIdValue, id) {
      this.dislogEdit = true
      this.userIds = userId
      this.platformIdValue = platformIdValue
      this.readId = id
    },
    destroy() {
      if (this.listArr.length === 0) {
        this.$message({
          type: 'error',
          message: '至少勾选一条信息'
        })
        return false
      }
      this.$confirm('确定要设为待销户吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var userIDArr = this.listArr.map(item => {
          return item.userId
        })
        var platArr = this.listArr.map(val => {
          return val.platformId
        })
        var dest = {
          type: 'userClose',
          userId: userIDArr.join(','),
          platformId: platArr.join(',')
        }
        newStatus(secret.Encrypt(dest)).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '设为待销户成功'
            })
            this.search()
          }
        })
      })
    },
    activate(text, code, calback) {
      if (this.listArr.length === 0) {
        this.$message({
          type: 'error',
          message: '至少勾选一条信息'
        })
        return false
      }
      this.$confirm('确定要' + text + '吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var userIDArr = this.listArr.map(item => {
          return item.userId
        })
        var platArr = this.listArr.map(val => {
          return val.platformId
        })
        var jihuo = {
          type: code,
          platformId: platArr.join(','),
          userId: userIDArr.join(',')
        }
        newStatus(secret.Encrypt(jihuo)).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: calback
            })
            this.search()
          }
        })
      })
    },
    // 积分组件
    watchPoint(scope) {
      this.pointDialog = true
      this.info = scope
    },
    // 子父组件传值(关联)
    closePoint(e) {
      console.log(e)
      this.pointDialogplat = false
      this.pointDialog = false
      if (e) {
        this.callBack(e)
      }
    },
    closePointss(e) {
      this.pointDialogplat = false
      this.pointDialog = false
    },
    closeDialog(val) {
      if (val === true) {
        this.search()
      }
      this.dialogTableVisible = false
      this.dislogEdit = false
      this.dialogAdd = false
      this.connectVal = false
    },
    // 校验结束时间
    checkTime(time) {
      var selectTime
      const newStr = new RegExp('-', 'g')
      if (!!time) { // eslint-disable-line
        selectTime = new Date(time.replace(newStr, '/')).getTime() // 所选时间
      } else {
        selectTime = ''
      }
      const nowTime = Date.now() // 现在的时间
      if (selectTime > nowTime) {
        this.$alert('所选时间不能大于当前时间！', '提示', {
          confirmButtonText: '确定',
          callback: action => {
            this.endDate = ''
          }
        })
      } else {
        if (!!time) {  // eslint-disable-line
          var start
          if (this.startDate !== null) {
            start = new Date(this.startDate.replace(newStr, '/')).getTime()
          } else {
            start = ''
          }
          var end = new Date(time.replace(newStr, '/')).getTime()
          if (end < start) {
            this.$message({
              message: '开始时间不能大于结束时间',
              type: 'error'
            })
            this.endDate = ''
          }
        }
      }
    },
    connectNum(scope) {
      this.connectVal = true
      this.dataVal = scope
    },
    cancelIce(userId, platformId) {
      console.log(userId)
      console.log(platformId)
      this.$confirm('确定要取消冻结吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var dtaa = {
          type: 'unfreeze',
          userId: userId,
          platformId: platformId
        }
        newStatus(secret.Encrypt(dtaa)).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '取消成功'
            })
            this.search()
          }
        })
      })
    },
    ice(userId, platformId) {
      console.log(userId)
      console.log(platformId)
      this.$confirm('确定要冻结吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var dtaa = {
          type: 'freezeUser',
          userId: userId,
          platformId: platformId
        }
        newStatus(secret.Encrypt(dtaa)).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '冻结成功'
            })
            this.search()
          }
        })
      })
    },
    maxAddress(userId, platform) {
      console.log(userId)
      console.log(platform)
      this.$confirm('确定要解绑MAC地址吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var mac = {
          type: 'unbindMAC',
          userId: userId,
          platformId: platform
        }
        newStatus(secret.Encrypt(mac)).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '解绑成功'
            })
            this.search()
          }
        })
      })
    },
    // 校验开始时间
    checkStartTime(time) {
      const newStr = new RegExp('-', 'g')
      // 比较是否大于现在的时间
      var selectTime
      if (!!time) { // eslint-disable-line
        selectTime = new Date(time.replace(newStr, '/')).getTime() // 所选时间
      } else {
        selectTime = ''
      }
      const nowTime = Date.now() // 现在的时间
      if (selectTime > nowTime) {
        this.$alert('所选时间不能大于当前时间！', '提示', {
          confirmButtonText: '确定',
          callback: action => {
            this.startDate = ''
          }
        })
      } else {
        if (!!time) {  // eslint-disable-line
          var end
          if (this.endDate !== null) {
            end = new Date(this.endDate.replace(newStr, '/')).getTime()
          } else {
            end = ''
          }
          var first = new Date(time.replace(newStr, '/')).getTime()
          if (!!end && first > end) {
            this.$message({
              message: '开始时间不能大于结束时间',
              type: 'error'
            })
            this.startDate = ''
          }
        }
      }
    },
    callBack(param) {
      newList(secret.Encrypt(param)).then(response => {
        this.list = response.data.list // 列表项
        this.count = parseInt(response.data.count) // 总数量
        this.pages = response.data.pages // 总页数
        this.pageid = parseInt(response.data.pageid) // 当前页数
        console.log('返回数据')
        console.log(response.data)
        this.searchRequest = param
        this.status = true
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    }
  }
}

</script>
<style lang="scss" scope>
  .el-collapse-item__content{
    padding-bottom: 0 !important;
  }
  /* .el-collapse-item__header{
    display: none !important;
  } */
  .collpe{
    .el-collapse-item__header{
      display: none !important;
    }
  }
</style>
<style rel="stylesheet/scss" lang="scss">
  .liantongpro {
    width: 100%;
    padding: 0 !important;
    /* margin: 0 auto !important; */
    /* display: flex; */
    justify-content: start;
    flex-wrap: wrap;
    /* float: left; */
  }

  .popverss {
    display: block;
    /* width: 80px; */
    width: 100%;
    margin: 5px auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

  }

  .popverss-top {
    padding-top: 5px;
  }

  .absolute {
    right: 30px;
    top: 3px;
  }

  .el-table .cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    padding: 0;
  }

  .liness {
    border-bottom: 1px solid #ebeef5;
    padding-bottom: 12px;
  }
  .app-head{
    padding: 6px 10px 0px 10px;
    border-radius: 10px;
  }
  .el-form-item{
    margin-bottom: 2px;
  }
  .addBtn{
    margin-top: 5px;
  }
  // table
/* .el-table td, .el-table th{
  padding: 4px 0 3px 0 !important;
} */
// .el-table{
//   position: absolute;
//   width: auto;
//   max-width: none;
// }
// .app-table{
//   position: relative;
//   overflow: auto;
// }
</style>
